package org.mycub.server.dataprovider;

import java.util.List;

import org.mycub.server.data.models.FreeParking;
import org.mycub.server.mongodb.MongoDB;

public class FreeParkingsProvider {

	/**
	 * @param args
	 */
	
	private List<FreeParking> parkings;

	public List<FreeParking> getParkings(double longitude, double latitude, double rayon){
		
		List<FreeParking> freeParkings = MongoDB.dataStore.find(FreeParking.class).
				field("location").within(longitude,latitude,rayon).asList();
		
		return freeParkings;
	}

	public List<FreeParking> getParkings() {
		return parkings;
	}

	public void setParkings(List<FreeParking> parkings) {
		this.parkings = parkings;
	}

}
